﻿namespace Liger.Web.UI
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    public class GridColumnSettingsBuilder
    {
        private readonly GridColumnSettings columnSettings;
        public GridColumnSettingsBuilder(GridColumnSettings columnSettings)
        {
            this.columnSettings = columnSettings;
        }

        /// <summary>
        /// 设置 默认列宽度
        /// </summary>
        public GridColumnSettingsBuilder ColumnWidth(int value)
        {
            this.columnSettings.ColumnWidth = value;
            return this;
        } 

        /// <summary>
        /// 设置 最小显示的列
        /// </summary>
        public GridColumnSettingsBuilder MinColToggle(int value)
        {
            this.columnSettings.MinColToggle = value;
            return this;
        } 

        /// <summary>
        /// 设置 是否允许调整列宽
        /// </summary>
        public GridColumnSettingsBuilder AllowAdjustColWidth(bool value)
        {
            this.columnSettings.AllowAdjustColWidth = value;
            return this;
        } 

        /// <summary>
        /// 设置 是否显示'切换列层'按钮
        /// </summary>
        public GridColumnSettingsBuilder AllowHideColumn(bool value)
        {
            this.columnSettings.AllowAdjustColWidth = value;
            return this;
        } 
    }
}
